<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>

<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jQselect.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>
</head>

<body>
	<div id="main">
		<div id="navigation">当前位置：测试关键字列表</div>
         <div id="topOtherMenu">
				<input type="button" name="insert" id="insert" value="添加测试关键字" class="button" onclick="location.href='<?php echo $this->projectUrl(array('action'=>'insert'));?>';" />
			</div>
<div id="body">
			<div id="search">
				<form id="searchForm" name="searchForm" method="post" action="<?php echo $this->projectUrl();?>">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td>关键字：
							  <input type="text" id="keyword" name="keyword" value="<?php echo $this->keyword;?>" class="input" style="width:120px;" >
							  &nbsp;
								类型：
								<select name="type" id="type" style="width:120px;">
                                <option value="">搜索类型</option>
								  <option value="1" 
                                  <?php if($this->type=="1"):?>
                                  selected="selected"
                                  <?php endif;?>
                                  >收货人和收货地址</option>
                                  
								  <option value="2" 
								  <?php if($this->type=="2"):?>
                                  selected="selected"
                                  <?php endif;?>>udid</option>
                                  
								  <option value="3"
                                  <?php if($this->type=="3"):?>
                                  selected="selected"
                                  <?php endif;?>
                                  >登录用户</option>
                                  
								  <option value="4"
                                  <?php if($this->type=="4"):?>
                                  selected="selected"
                                  <?php endif;?>
                                  >sourceId</option>
                              </select>
								&nbsp;产品编号：
								<select name="productCode" id="productCode" style="width:120px;">
                                 	<option value="">所有产品</option>
                                    <?php foreach($this->products as $product):?>
                                    	<option value="<?php echo $product['code'];?>"
                                        <?php if($this->productCode==$product['code']):?>
                                        selected="selected"
                                        <?php endif;?>
                                        ><?php echo $product['name'];?></option>
                                    <?php endforeach;?>
                                </select>
					          <input type="submit" name="button" id="button" value="查找" class="button" />
&nbsp;					</td>
						</tr>
						<tr>
							<td style="font-weight:bold; color:#FF0000;">启动数据屏蔽规则：udid、登录用户、sourceId按关键字<font style="color:#0000FF">精确匹配</font>；订单数据屏蔽规则：udid、登录用户、sourceId按关键字<font style="color:#0000FF">精确匹配</font>，收货人和收货地址按是否含有关键字<font style="color:#006600;">模糊匹配；</font></td>
						</tr>
					</table>
				</form>
                
			</div>
           
			<div id="content">
				<form id="listForm" name="listForm" method="post" action="">
					<table class="table">
						<tr class="subject">
                     
							<td width="5%" class="checkBoxTd">选择</td>
                       
							<td>关键字</td>
							<td>类型</td>
						  <td>产品</td>
						  <td>添加用户</td>
						  <td>添加时间</td>
							<td class="checkBoxTd">操作</td>
						</tr>
                        <?php foreach($this->rows as $row):?>
						<tr class="dataLine">
                       
							<td width="5%" class="checkBoxTd"><input type="checkbox" name="selectId[]" id="select0" class="selectCheckBox" value="<?php echo $row['id'];?>" /></td>
                          
							<td><?php echo $row['value'];?></td>
							<td><?php 
							switch ($row['type'])
								{
								case 1:
								  echo '收货人和收货地址';
								  break;  
								case 2:
								  echo '按udid';
								  break;
								case 3:
								  echo '按登录用户';
								  break;
								case 4:
								  echo '按sourceId';
								  break;
								}
							?></td>
							<td><?php 
							if(!$this->productModel->getProductNameByProductCode($row['productCode'])) {
								echo '所有';
							} else {
								echo $this->productModel->getProductNameByProductCode($row['productCode']);
							}
							?></td>
							<td><?php echo $row['addUserName'];?></td>
							<td><?php echo $row['addTime'];?></td>
							<td class="checkBoxTd"><a href="<?php echo $this->projectUrl(array('id'=>$row['id'], 'action'=>'update','backUrl'=>urlencode($this->pageUrl)));?>">编辑</a></td>
						</tr>
                        <?php endforeach;?>
					</table>
<table class="controlTable">
						<tr>
							<td align="left"><input type="button" name="all" id="all" value="全选" class="button" onclick="$('.selectCheckBox').attr('checked', true);"/>
								<input type="button" name="cancel" id="cancel" value="取消" class="button" onclick="$('.selectCheckBox').attr('checked', false);"/>
                                
								<input type="submit" name="delete" id="delete" value="删除" class="button" onclick="return del();"/></td>
							 <td colspan="6" class="paginator"><div align="right"><?php echo $this->pageString;?></div></td>
		  </tr>
					</table>
			  </form>
			</div>
		</div>
</div>
<script language="javascript">
function del()
{
	if (confirm('确定删除吗？')) {
	
	
		$("#listForm").attr('action', '<?php echo $this->projectUrl(array('action'=>'delete','backUrl'=>urlencode($this->pageUrl))) ;?>');
		$("#listForm").submit();
		return true;
	} else {
		return false;
	}
}
</script>
</body>
</html>